package com.edu.service.impl;

import java.util.List;

import com.edu.bean.Goods;
import com.edu.bean.Page;
import com.edu.dao.GoodsDao;
import com.edu.dao.impl.GoodsDaoImpl;
import com.edu.service.GoodsService;

public class GoodsServiceImpl implements GoodsService {
	
	GoodsDao goodsDao = new GoodsDaoImpl();
	
	@Override
	public Page<Goods> getAllGoods(int pageNum, int pageSize) {
		List<Goods> goodsList = goodsDao.selectAllGoods(pageNum, pageSize);
		int rows = goodsDao.selectAllGoodsNum();
		Page<Goods> page = new Page(goodsList,pageNum,pageSize,rows);
		return page;
	}

	@Override
	public int deleteGoodById(int goodId) {
		return goodsDao.deleteGoodById(goodId);
	}

}
